package com.fr.chicken.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class MyConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //其中images表示访问的前缀。"file:D:/OTA/"是文件真实的存储路径
        registry.addResourceHandler("/images/**").addResourceLocations("file:C:/chicken/images/");
    }
}
